﻿@model PagedList.IPagedList<CadeMeuMedico.Models.Medicos>
@using PagedList.Mvc;
<link href="~/Content/PagedList.css" rel="stylesheet" type="text/css" />      

@{
    ViewBag.Title = "Médicos";
}

@section Scripts{

    @*<script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&mkt=pt-BR"></script>
      <script type="text/javascript" src="~/Scripts/Maps.js"></script>*@

    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
    <script type="text/javascript" src="~/Scripts/Maps.Google.js"></script>
}

<h2>Consultar Médicos</h2>

@using (Html.BeginForm("Index", "ConsultaMedicos", FormMethod.Get))

{
<p>
    <b>Especialidade</b> <br /> 
    @Html.DropDownList("idEspecialidade", (IList<SelectListItem>)ViewBag.EspecialidadesSelectList, "Todas", new { ViewBag.CurrentFilter, @class = "form-control input-sm" }) <br />
    <b>Cidade</b> <br /> 
    @Html.DropDownList("idCidade", (IList<SelectListItem>)ViewBag.CidadesSelectList, "Todas", new { ViewBag.CurrentFilter, @class = "form-control input-sm" }) <br />
    <input type="submit" class="btn btn-primary" value="Filtrar" />
</p>
}

<table class="table table-striped">
    <tr>
        <th>
            @Html.ActionLink("CRM", "Index", new { sortOrder = ViewBag.CrmSortParm, idEspecialidade = ViewBag.IdEspecialidade, idCidade = ViewBag.IdCidade })
        </th>
        <th>
            @Html.ActionLink("Nome", "Index", new { sortOrder = ViewBag.NomeSortParm, idEspecialidade = ViewBag.IdEspecialidade, idCidade = ViewBag.IdCidade })
        </th>
        <th>
            <label>Endereço</label>
        </th>
        <th>
            <label>E-mail</label>
        </th>
        <th>
            <label>Atende por convênio</label>
        </th>
        <th>
            <label>Site</label>
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.CRM)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Nome)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Endereco)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Email)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.AtendePorConvenio)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.WebsiteBlog)
            </td>
            <td>
                @Html.HiddenFor(modelItem => item.IDMedico)
                <input type="button" class="btn btn-primary" id="btnShowLocations" value="Rota" />
                <input type="hidden" id="txtEnderecoPartida" name="txtEnderecoPartida" />
            </td>
        </tr>
    }

</table>

<br />

Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount
@Html.PagedListPager(Model, page => Url.Action("Index", new { page, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter }))

<br />
<article>
    <div id="map_canvas" style="width:auto; height:400px;"></div>
    <div id="trajeto-texto" style="height: 300px; width: auto;"></div>
</article>



